import React from 'react'
import '../../styles/sidebar/footer.css'
import axios from 'axios'
import Axios from 'axios';
axios.default.widthCredentials = true

class Footer extends React.Component {
    goback() {
        Axios.get('http://localhost:4000/logout')
            .then(res => {
                localStorage.removeItem("token");
                localStorage.removeItem("profile");
                console.log(this)
                // this.props.history.go(0)
            })
    }

    render() {
        return (
            <div className="footer">
                <ul className='foot-list'>
                    <li>
                        <span className="iconfont">&#xe6cf;</span>
                        <p>夜间模式</p>
                    </li>
                    <li>
                        <span className="iconfont">&#xe696;</span>
                        <p>设置</p>
                    </li>
                    <li>
                        <span className="iconfont">&#xe503;</span>
                        <p onClick={this.goback.bind(this)}>退出</p>
                    </li>
                </ul>
            </div>
        )
    }
}

export default Footer